# Contributor: Díaz Urbaneja Diego <sodomon2@gmail.com>
# Maintainer: Díaz Urbaneja Diego <sodomon2@gmail.com>
pkgname=godot
pkgver=3.2.2
pkgrel=0
pkgdesc="An advanced, feature packed, multi-platform 2D and 3D game engine"
url="http://www.godotengine.org"
arch="x86_64" # deactivated for other architecture due to conflicts between binaries
license="MIT"
# TODO: Use system freetype instead of bundled one.
makedepends="scons gcc python3 libxcursor-dev libxinerama-dev libexecinfo-dev
	libxrandr-dev libxi-dev libx11-dev alsa-lib-dev mesa-dev yasm-dev"
options="!check" # no testsuites
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/godotengine/godot/archive/$pkgver-stable.tar.gz
	crash_handler_x11.patch"
builddir="$srcdir/$pkgname-$pkgver-stable"

build() {
	scons platform=x11 \
	tools=yes \
	target=release_debug \
	use_llvm=no \
	colored=yes \
	pulseaudio=no bits=64 -j4
}

package() {
	install -Dm644 misc/dist/linux/org.godotengine.Godot.desktop "$pkgdir/usr/share/applications/godot.desktop"
	install -Dm644 icon.svg "$pkgdir/usr/share/pixmaps/godot.svg"

	install -D -m755 bin/godot.x11.opt.tools.64 "$pkgdir/usr/bin/godot"
	install -D -m644 misc/dist/linux/godot.6 "$pkgdir/usr/share/man/man6/godot.6"
}
sha512sums="1f3fa639daa05e5a92a407d20ba6430b60b55dede57b3e1984ada93e74d94a40bc05f374edd8ba7a929808fae46ee25b87c1e59701d1e5a5a24292a891b6b861  godot-3.2.2.tar.gz
3d1d31a55dedbf66aba212d127351d9d9c89e2575bd50cdb6d9a6c40c240fdfdcb508f03562aedd8ef04acf8442ad5422522f0242a49ae06819a2f97983f0b44  crash_handler_x11.patch"
